"""
Author        yongfa
Date          2022-07-14 13:49:02
LastEditTime  2023-07-27 19:11:10
LastEditors   yongfa
Description   权限初始化数据
"""


api_map = [

    {
        "name": "permission",
        "label": "权限管理",
        "path": "/permission",
        "group": "permission",
        "children": [
            {
                "name": "user",
                "label": "用户管理",
                "path": "/users",
                "group": "user",
                "children": [
                 {
                     "name": "getUser",
                     "label": "用户列表",
                     "path": "/api/v1/users",
                     "endpoint": "user.user_list",
                     "group": "user",
                     "method": "GET"
                 },
                    {
                     "name": "createUser",
                     "label": "用户创建",
                     "path": "/api/v1/users",
                     "endpoint": "user.user_create",
                     "group": "user",
                     "method": "POST"
                 },
                    {
                     "name": "getUserDetail",
                     "label": "用户详情",
                     "path": "/api/v1/users/<int:id>",
                     "endpoint": "user.user_detail",
                     "group": "user",
                     "method": "GET"
                 },
                    {
                     "name": "updateUser",
                     "label": "用户更新",
                     "path": "/api/v1/users/<int:id>",
                     "endpoint": "user.user_update",
                     "group": "user",
                     "method": "PUT"
                 },
                    {
                     "name": "deleteUser",
                     "label": "用户删除",
                     "path": "/api/v1/users/<int:id>",
                     "endpoint": "user.user_delete",
                     "group": "user",
                     "method": "DELETE"
                 },
                    {
                     "name": "userInfo",
                     "label": "用户信息",
                     "path": "/api/v1/users/info",
                     "endpoint": "user.user_info",
                     "group": "user",
                     "method": "GET"
                 },
                    {
                     "name": "userPassword",
                     "label": "用户修改密码",
                     "path": "/api/v1/users/password",
                     "endpoint": "user.user_password",
                     "group": "user",
                     "method": "PUT"
                 },
                    {
                     "name": "userAvatar",
                     "label": "用户上传头像",
                     "path": "/api/v1/users/avatar",
                     "endpoint": "user.user_avatar",
                     "group": "user",
                     "method": "POST"
                 },
                ]
            },
            {
                "name": "role",
                "label": "角色管理",
                "path": "/roles",
                "group": "role",
                "children": [
                    {
                        "name": "getRole",
                        "label": "角色列表",
                        "path": "/api/v1/permission/roles",
                        "endpoint": "role.role_list",
                        "group": "role",
                        "method": "GET"
                    },
                    {
                        "name": "getRoleTree",
                        "label": "角色树形列表",
                        "path": "/api/v1/permission/roles/tree",
                        "endpoint": "role.role_tree",
                        "group": "role",
                        "method": "GET"
                    },
                    {
                        "name": "createRole",
                        "label": "角色创建",
                        "path": "/api/v1/permission/roles",
                        "endpoint": "role.role_create",
                        "group": "role",
                        "method": "POST"
                    },
                    {
                        "name": "getRoleDetail",
                        "label": "角色详情",
                        "path": "/api/v1/permission/roles/<int:id>",
                        "endpoint": "role.role_detail",
                        "group": "role",
                        "method": "GET"
                    },
                    {
                        "name": "updateRole",
                        "label": "角色更新",
                        "path": "/api/v1/permission/roles/<int:id>",
                        "endpoint": "role.role_update",
                        "group": "role",
                        "method": "PUT"
                    },
                    {
                        "name": "deleteRole",
                        "label": "角色删除",
                        "path": "/api/v1/permission/roles/<int:id>",
                        "endpoint": "role.role_delete",
                        "group": "role",
                        "method": "DELETE"
                    },
                    {
                        "name": "copyRole",
                        "label": "角色复制",
                        "path": "/api/v1/permission/roles/copy",
                        "endpoint": "role.role_copy",
                        "group": "role",
                        "method": "POST"
                    },
                ]
            },
            {
                "name": "menu",
                "label": "菜单管理",
                "path": "/menus",
                "group": "menu",
                "children": [
                    {
                        "name": "getMenu",
                        "label": "菜单列表",
                        "path": "/api/v1/permission/menus",
                        "endpoint": "menu.menu_list",
                        "group": "menu",
                        "method": "GET"
                    },
                    {
                        "name": "getMenuTree",
                        "label": "菜单树形列表",
                        "path": "/api/v1/permission/menus/tree",
                        "endpoint": "menu.menu_tree",
                        "group": "menu",
                        "method": "GET"
                    },
                    {
                        "name": "createMenu",
                        "label": "菜单创建",
                        "path": "/api/v1/permission/menus",
                        "endpoint": "menu.menu_create",
                        "group": "menu",
                        "method": "POST"
                    },
                    {
                        "name": "getMenuDetail",
                        "label": "菜单详情",
                        "path": "/api/v1/permission/menus/<int:id>",
                        "endpoint": "menu.menu_detail",
                        "group": "menu",
                        "method": "GET"
                    },
                    {
                        "name": "updateMenu",
                        "label": "菜单更新",
                        "path": "/api/v1/permission/menus/<int:id>",
                        "endpoint": "menu.menu_update",
                        "group": "menu",
                        "method": "PUT"
                    },
                    {
                        "name": "deleteMenu",
                        "label": "菜单删除",
                        "path": "/api/v1/permission/menus/<int:id>",
                        "endpoint": "menu.menu_delete",
                        "group": "menu",
                        "method": "DELETE"
                    },
                ]
            },
            {
                "name": "api",
                "label": "API管理",
                "path": "/apis",
                "group": "api",
                "children": [
                    {
                        "name": "getApi",
                        "label": "API列表",
                        "path": "/api/v1/permission/apis",
                        "endpoint": "api.api_list",
                        "group": "api",
                        "method": "GET"
                    },
                    {
                        "name": "getApiTree",
                        "label": "API树形列表",
                        "path": "/api/v1/permission/apis/tree",
                        "endpoint": "api.api_tree",
                        "group": "api",
                        "method": "GET"
                    },
                    {
                        "name": "createApi",
                        "label": "API创建",
                        "path": "/api/v1/permission/apis",
                        "endpoint": "api.api_create",
                        "group": "api",
                        "method": "POST"
                    },
                    {
                        "name": "getApiDetail",
                        "label": "API详情",
                        "path": "/api/v1/permission/apis/<int:id>",
                        "endpoint": "api.api_detail",
                        "group": "api",
                        "method": "GET"
                    },
                    {
                        "name": "updateApi",
                        "label": "API更新",
                        "path": "/api/v1/permission/apis/<int:id>",
                        "endpoint": "api.api_update",
                        "group": "api",
                        "method": "PUT"
                    },
                    {
                        "name": "deleteApi",
                        "label": "API删除",
                        "path": "/api/v1/permission/apis/<int:id>",
                        "endpoint": "api.api_delete",
                        "group": "api",
                        "method": "DELETE"
                    },
                ]
            },
        ]
    },
    {
        "name": "logs",
        "label": "系统日志",
        "path": "/logs",
        "group": "logs",
        "children": [
            {
                "name": "getLogs",
                "label": "日志列表",
                "path": "/api/v1/logs",
                "endpoint": "logs.logs_list",
                "group": "logs",
                "method": "GET"
            },
            {
                "name": "getLogsDetail",
                "label": "日志详情",
                "path": "/api/v1/logs/<int:id>",
                "endpoint": "logs.logs_detail",
                "group": "logs",
                "method": "GET"
            },
            {
                "name": "deleteLogs",
                "label": "日志删除",
                "path": "/api/v1/logs/<int:id>",
                "endpoint": "logs.logs_delete",
                "group": "logs",
                "method": "DELETE"
            }
        ]
    },
    {
        "name": "upload",
        "label": "系统文件",
        "path": "/upload",
        "group": "upload",
        "children": [
            {
                "name": "upload",
                "label": "文件上传",
                "path": "/api/v1/upload",
                "endpoint": "upload.upload",
                "group": "upload",
                "method": "POST"
            },
            {
                "name": "getUpload",
                "label": "文件列表",
                "path": "/api/v1/upload",
                "endpoint": "upload.upload_list",
                "group": "upload",
                "method": "GET"
            },
            {
                "name": "getUploadDetail",
                "label": "文件详情",
                "path": "/api/v1/upload/<int:id>",
                "endpoint": "upload.upload_detail",
                "group": "upload",
                "method": "GET"
            },
            {
                "name": "deleteUpload",
                "label": "文件删除",
                "path": "/api/v1/upload",
                "endpoint": "upload.upload_delete",
                "group": "upload",
                "method": "DELETE"
            }
        ]
    },
    {
        "name": "dict",
        "label": "字典管理",
        "path": "/dict",
        "group": "dict",
        "children": [
            {
                "name": "dictTypes",
                "label": "字典类型",
                "path": "/types",
                "group": "types",
                "children": [
                    {
                        "name": "getDictTypes",
                        "label": "字典类型列表",
                        "path": "/api/v1/dict/types",
                        "endpoint": "dict.types_list",
                        "group": "types",
                        "method": "GET"
                    },
                    {
                        "name": "getDictTypesTree",
                        "label": "字典类型树形列表",
                        "path": "/api/v1/dict/types/tree",
                        "endpoint": "dict.types_tree",
                        "group": "types",
                        "method": "GET"
                    },
                    {
                        "name": "getDictTypesDetail",
                        "label": "字典类型详情",
                        "path": "/api/v1/dict/types/<int:id>",
                        "endpoint": "dict.types_detail",
                        "group": "types",
                        "method": "GET"
                    },
                    {
                        "name": "createDictTypes",
                        "label": "字典类型创建",
                        "path": "/api/v1/dict/types",
                        "endpoint": "dict.types_create",
                        "group": "types",
                        "method": "POST"
                    },
                    {
                        "name": "updateDictTypes",
                        "label": "字典类型更新",
                        "path": "/api/v1/dict/types/<int:id>",
                        "endpoint": "dict.types_update",
                        "group": "types",
                        "method": "PUT"

                    },
                    {
                        "name": "deleteDictTypes",
                        "label": "字典类型删除",
                        "path": "/api/v1/dict/types/<int:id>",
                        "endpoint": "dict.types_delete",
                        "group": "types",
                        "method": "DELETE"

                    }
                ]
            },
            {
                "name": "dictItems",
                "label": "字典项",
                "path": "/items",
                "group": "items",
                "children": [
                    {
                        "name": "getDictItems",
                        "label": "字典项列表",
                        "path": "/api/v1/dict/items",
                        "endpoint": "dict.items_list",
                        "group": "items",
                        "method": "GET"

                    },
                    {
                        "name": "getDictItemsTree",
                        "label": "字典项树形列表",
                        "path": "/api/v1/dict/items/tree",
                        "endpoint": "dict.items_tree",
                        "group": "items",
                        "method": "GET"

                    },
                    {
                        "name": "getDictItemsDetail",
                        "label": "字典项详情",
                        "path": "/api/v1/dict/items/<int:id>",
                        "endpoint": "dict.items_detail",
                        "group": "items",
                        "method": "GET"
                    },
                    {
                        "name": "createDictItems",
                        "label": "字典项创建",
                        "path": "/api/v1/dict/items",
                        "endpoint": "dict.items_create",
                        "group": "items",
                        "method": "POST"
                    },
                    {
                        "name": "updateDictItems",
                        "label": "字典项更新",
                        "path": "/api/v1/dict/items/<int:id>",
                        "endpoint": "dict.items_update",
                        "group": "items",
                        "method": "PUT"
                    },
                    {
                        "name": "deleteDictItems",
                        "label": "字典项删除",
                        "path": "/api/v1/dict/items/<int:id>",
                        "endpoint": "dict.items_delete",
                        "group": "items",
                        "method": "DELETE"
                    }
                ]
            }
        ]
    }



]

menu_map = [
    {
        "name": "permission",
        "label": "权限管理",
        "path": "/permission",
        "children": [
            {
                "name": "user",
                "label": "用户管理",
                "path": "/user",
                "component": ""
            },
            {
                "name": "role",
                "label": "角色管理",
                "path": "/role",
                "component": ""
            },
            {
                "name": "menu",
                "label": "菜单管理",
                "path": "/menu",
                "component": ""
            },
            {
                "name": "api",
                "label": "API管理",
                "path": "api",
                "component": ""
            },
        ]
    },
    {
        "name": "logs",
        "label": "系统日志",
        "path": "/logs",
        "children": [
            {
                "name": "logsManage",
                "label": "日志管理",
                "path": "/logs",
                "component": ""
            }
        ]
    },
    {
        "name": "upload",
        "label": "系统文件",
        "path": "/upload",
        "children": [
            {
                "name": "uploadManage",
                "label": "文件管理",
                "path": "/upload",
                "component": ""
            }
        ]
    },
    {
        "name": "dict",
        "label": "字典管理",
        "path": "/dict",
        "children": [
            {
                "name": "dictTypes",
                "label": "字典类型",
                "path": "/dict/types",
                "component": ""

            },
            {
                "name": "dictItems",
                "label": "字典项",
                "path": "/dict/items",
                "component": ""
            }
        ]
    },

]

roles_permissions_map = {
    "超级管理员": {
        "is_super_admin": True,
    },
    "管理员": {
        "menus": [
            "权限管理", "用户管理", "菜单管理", "API管理", "角色管理"
            "系统日志", "日志管理",
            "系统文件", "文件管理",
            "字典管理", "字典类型", "字典项",

        ],
        "apis": [
            "用户列表", "用户创建", "用户详情", "用户更新", "用户删除", "用户信息", "用户修改密码", "用户上传头像",
            "角色列表", "角色树形列表", "角色创建", "角色详情", "角色更新", "角色删除", "角色复制",
            "菜单列表", "菜单树形列表", "菜单创建", "菜单详情", "菜单更新", "菜单删除",
            "API列表", "API树形列表", "API创建", "API详情", "API更新", "API删除",
            "日志列表", "日志详情", "日志删除",
            "文件上传", "文件列表", "文件详情", "文件删除",
            "字典类型列表", "字典类型树形列表", "字典类型创建", "字典类型详情", "字典类型更新", "字典类型删除",
            "字典项列表", "字典项树形列表", "字典项创建", "字典项详情", "字典项更新", "字典项删除",
            "字典项列表", "字典项树形列表", "字典项创建", "字典项详情", "字典项更新", "字典项删除",

        ]
    },
    "普通用户": {
        "apis": [
            "用户信息", "用户修改密码", "用户上传头像",
            "字典类型列表", "字典类型详情", "字典类型树形列表",
            "字典项列表", "字典项详情", "字典项树形列表",
        ]
    },
    "第三方用户": {},
}
